home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
awe2-0_1.lha
/
awe2-0.1
/
Src
/
RCS
/
Thread.h,v
< prev
next >
Wrap
Text File
|
1989-10-24
|
4KB
|
263 lines
head 3.3;
branch ;
access ;
symbols ;
locks grunwald:3.3; strict;
comment @ * @;
3.3
date 89.10.24.13.08.38; author grunwald; state Exp;
branches ;
next 3.2;
3.2
date 89.02.20.15.37.49; author grunwald; state Exp;
branches ;
next 3.1;
3.1
date 88.12.20.13.50.25; author grunwald; state Exp;
branches ;
next 1.2;
1.2
date 88.10.30.13.06.13; author grunwald; state Exp;
branches ;
next 1.1;
1.1
date 88.09.18.16.42.15; author grunwald; state Exp;
branches ;
next ;
desc
@@
3.3
log
@*** empty log message ***
@
text
@// This may look like C code, but it is really -*- C++ -*-
//
// Copyright (C) 1988 University of Illinois, Urbana, Illinois
//
// written by Dirk Grunwald (grunwald@@cs.uiuc.edu)
//
#ifndef THREADH
#define THREADH
#pragma once
#include <Awesime.h>
#include <HardwareContext.h>
#include <ThreadContainer.h>
#include <stream.h>
enum ThreadState { SUSPENDED, RUNNING, RUNNABLE, ZOMBIED, TERMINATED };
static const double NullTime = -1;
typedef int ThreadPriority;
class CpuMultiplexor;
class SingleCpuMux;
class MultiCpuMux;
class SimulationMultiplexor;
class Thread : public Awesime {
friend class CpuMultiplexor;
friend class SingleCpuMux;
friend class MultiCpuMux;
friend class SimulationMultiplexor;
HardwareContext pContext;
ThreadState threadState;
ThreadPriority threadPriority;
short cpuAffinity;
ThreadContainer suspendedOn;
void startOff();
void makeTerminated();
char* threadName;
protected:
void name(char *);
void state(ThreadState s);
void makeRunnable();
virtual void main();
public:
Thread(char* name ="", unsigned stacksize = 1010,
ThreadPriority priority = 0,
bool debug = 0, int checkStack = 1);
virtual ~Thread();
//
// access functions
//
const HardwareContext * context();
char* name();
ThreadState state();
long maxStackDepth();
void checkStack();
void priority(ThreadPriority newPriority);
ThreadPriority priority();
//
// action functions
//
virtual void classPrintOn(ostream& strm);
};
inline char*
Thread::name()
{
return threadName;
}
inline void
Thread::name(char *name)
{
threadName = name;
}
inline void
Thread::state(ThreadState s)
{
threadState = s;
}
inline ThreadState
Thread::state()
{
return threadState;
}
inline long
Thread::maxStackDepth()
{
return( pContext.maxStackDepth() );
}
inline void
Thread::checkStack()
{
pContext.checkStack();
}
inline ThreadPriority
Thread::priority()
{
return(threadPriority);
};
inline void
Thread::priority(ThreadPriority newPriority)
{
threadPriority = newPriority;
}
#endif THREADH
@
3.2
log
@Start using Gnu library heaps for schedulers
@
text
@d9 1
d11 4
a14 4
#include "Awesime.h"
#include "HardwareContext.h"
#include "ThreadContainer.h"
#include "stream.h"
d18 2
d23 2
d30 2
d58 1
a58 1
int debug = 0, int checkStack = 1);
@
3.1
log
@Steay version
@
text
@@
1.2
log
@*** empty log message ***
@
text
@d31 1
d62 1
d64 2
d104 6
@
1.1
log
@Initial revision
@
text
@d1 6
d19 2
a20 1
class HardwareCpu;
d24 2
a25 1
friend class HardwareCpu;
a28 1
const char* threadName;
d36 1
d40 2
a41 4
inline ThreadState state(ThreadState s) {
threadState = s;
return s;
}
d48 1
a48 1
Thread(const char* name ="", unsigned stacksize = 1010,
d50 1
a50 1
int debug = 0);
d59 1
a59 1
const char* name();
d62 1
a63 1
ThreadPriority priority(ThreadPriority newPriority);
d72 1
a72 1
inline const char*
d78 12
d108 1
a108 1
inline ThreadPriority
a110 1
ThreadPriority t = threadPriority;
a111 1
return(t);
@